/**
 * Created with IntelliJ IDEA.
 * User: Lorenzo
 * Date: 15-5-19
 * Time: 上午11:36
 * To change this template use File | Settings | File Templates.
 */

var purchaseGroupModel = {
    purchase_id:"haha",
    purchateam_code:"",
    purchateam_name:"",
    purchase_type:"",
    purchase_per:"",
    note:"",
    CreateUser:"",
    CreateDate:"",
    WriteUser:"",
    WriteDate:"",
    purchase_persos:[],
    purchase_products:[],

    init: function() {
        this.purchase_id = $('#purchase_id').val();
        this.purchateam_code = $('#purchase_code').val();
        this.purchateam_name = $('#purchase_name').val();
        this.purchase_type = $('#purchase_type').val();
        this.purchase_per = $('#purchase_per').val();
        this.note = $('#note').val();
        this.CreateUser = $('#CreateUser').val();
        this.CreateDate = $('#CreateDate').val();
        this.WriteUser = $('#WriteUser').val();
        this.WriteDate = $('#WriteDate').val();
        this.purchase_type = $('#purchase_type').val();
        this.purchase_type = $('#purchase_type').val();
    },

    fetchModel: function(purchaseData) {
        this.purchase_id = purchaseData.purchase_id;
        this.purchateam_code = purchaseData.purchateam_code;
        this.purchateam_name = purchaseData.purchateam_name;
        this.purchase_type = purchaseData.purchase_type;
        this.purchase_per = purchaseData.purchase_per;
        this.note = purchaseData.note;
        this.CreateUser = purchaseData.CreateUser;
        this.CreateDate = purchaseData.CreateDate;
        this.WriteUser = purchaseData.WriteUser;
        this.WriteDate = purchaseData.WriteDate;
        this.purchase_type = purchaseData.purchase_type;
        this.purchase_type = purchaseData.purchase_type;
        this.purchase_persos = purchaseData.purchase_persos;
        this.purchase_products = purchaseData.purchase_products;
    }

}

var purchase_personModel = {
    purchaseper_id:"",
    purchateam_code:"",
    purchaser_code:"",
    purchaser_name:"",
    purchaser_phone:"",
    purchaser_note:"",
    CreateUser:"",
    CreateDate:"",
    WriteUser:"",
    WriteDate:"",
    isEdit: true,
    flag: 0,//0:明细,1:新增,2:编辑

    init: function() {
        this.purchaseper_id = $('#purchaseper_id').val();
        this.purchateam_code = $('#purchateam_code').val();
        this.purchaser_code = $('#purchaser_code').val();
        this.purchaser_name = $('#purchaser_name').val();
        this.purchaser_phone = $('#purchaser_phone').val();
        this.purchaser_note = $('#purchaser_note').val();
        this.CreateUser = $('#CreateUser').val();
        this.CreateDate = $('#CreateDate').val();
        this.WriteUser = $('#WriteUser').val();
        this.WriteDate = $('#WriteDate').val();
    },
    fetchModel: function(purchaseData) {
        this.purchaseper_id = purchaseData.purchaseper_id;
        this.purchateam_code = purchaseData.purchateam_code;
        this.purchaser_code = purchaseData.purchaser_code;
        this.purchaser_name = purchaseData.purchaser_name;
        this.purchaser_phone = purchaseData.purchaser_phone;
        this.purchaser_note = purchaseData.purchaser_note;
        this.CreateUser = purchaseData.CreateUser;
        this.CreateDate = purchaseData.CreateDate;
        this.WriteUser = purchaseData.WriteUser;
        this.WriteDate = purchaseData.WriteDate;
    }

}